//
//  ORBasicInfo.m
//  OR_1
//
//  Created by Luboš Kulič on 9/15/10.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import "ORBasicInfo.h"


static NSString * parsedElementName_ = @"D:ZAU";


@implementation ORBasicInfo

+(void) load {
	[super registerParser:self  ForElement:parsedElementName_];	
}

-(id) init {
	if(!(self = [super init])) {
		return 0;
	}
	self->rootElementName_ = parsedElementName_;
	return self;
}

-(NSUInteger)numberOfValues {
	return 3;	
}


-(id) valueForIndex:(int)index {
	switch (index) {
	case 0: return businessName;
	break;
	case 1: return ICO;
	break;
	case 2: return legalForm;
	};
	return nil;
}


/******************************************************************************************/


-(void) parserWillStartSubelement:(NSString *)elementName withWorker:(XMLParserWorker *)newWorker {
	// store subelement into a proper list	
}

-(void) parserDidEndRootElementWithData:(NSString *)parsedElementData{
	// get data from data dictionary and store them into the proper attributes
	
	businessName = [[retData objectForKey:@"D:OF"] data];
	ICO = [[retData objectForKey:@"D:ICO"] data];
	legalForm = [[retData objectForKey:@"D:NPF"] data];
	
}



/******************************************************************************************/

-(NSString *) description {
	return [NSString stringWithFormat:@"{name: %@, ICO: %@, legal form: %@}",
				businessName, ICO, legalForm];
	
}





@end
